import React, {Component} from "react";
import {withRouter} from 'react-router'
import {observer, inject} from 'mobx-react';

import {getOrderBasicData} from '../../api/user'
import Header from '../../components/header'
import styless from './assets/login.module.less'


@inject('store')
@observer
class Login extends Component {
  constructor(props) {
    super(props)

    this.state = {
      data: {}
    }
  }

  componentDidMount() {
    console.log(this.props.store);
    this.props.store.test.fetchTodos()

    getOrderBasicData().then(res => {
      console.log(res);
    })
  }

  hanbleButton = () => {
    console.log(123);
    this.props.store.test.fetchTodoAdd()
  }

  render() {
    return (
      <div>
        <Header/>

        <p className={styless.assets}>登录{this.props.store.test.total}</p>
        <button onClick={this.hanbleButton}>增加</button>
      </div>
    )
  }
}

export default withRouter(Login)
